<?php
/**
 * User: Peter Wang
 * Date: 17/3/14
 * Time: 下午3:49
 */

namespace App\Glob\Service\Setting;


use App\Glob\Service\AccountService;
use App\Lib\Dao\Setting\AdminActionLogDao;

class ActionLogService
{

    public function logAction($pathinfo, $inputData="")
    {
        $obj = new AccountService();
        $user = $obj->getLogin();
        if(!$user) return ;
        $email = $user['email'];
        $data = [];
        $data['account'] = $email;
        $data['route'] = $pathinfo;
        $data['input_data'] = $inputData;
        $data['created_at'] = date('Y-m-d H:i:s');
        $data['updated_at'] = date('Y-m-d H:i:s');
        $logObj = new AdminActionLogDao();
        return $logObj->insert($data);
    }

}